<?php
	class Application
	{
		static $Parameters;
		static $Router;
		static $User;
		
		// Method to load Basic Paremeters for the whole application like : Database paremeters, Site URL,...
		static function loadParameters($params)
		{
			self::$Parameters = $params;
		}
	
		// to get the parameter we need later
		static function getParameter($paramName)
		{
			if (array_key_exists($paramName, self::$Parameters))
				return self::$Parameters[$paramName];
			else
				return null;
		}
	
		// set the router
		static function setRouter($router)
		{
			self::$Router = $router;
		}
	
		// call the delegate funcion of router and let him handle the request
		static function route($path)
		{
			self::$Router->delegate($path);
		}
	
		// Method run()  will be called at the index.php page
		static function run()
		{
			self::updateUserInfo();
			self::$Router->setPath (SITE_PATH. 'controllers');
			self::$Router->delegate();
		}
	
		// Clear all the User Session
		static function clearUserSession()
		{
			self::$User = null;
			//$authNamespace = new Zend_Session_Namespace('Zend_Auth');
			//$authNamespace->storage = self::$User;		

			//TODO: clear any other user session related info
		}
	
		// Get the User
		static function getUser()
		{
			return self::$User;
		}
	
		// Update the User Info
		static function updateUserInfo()
		{
			//$authNamespace = new Zend_Session_Namespace('Zend_Auth');
			//self::$User = $authNamespace->storage;		
		
		}
	
		// Method to log out
		static function logout()
		{
			self::clearUserSession();
		}
	}
?>